# coding:utf-8

from marshmallow import fields

from ..extensions import ma
from .utils import EmptyStrValidator


class LoginSchema(ma.Schema):
    """
    created by chenhj at 2017/8/15

    """
    mobile = fields.Str(required=True, error_messages={
        'required': '手机号不合法'
    }, validate=EmptyStrValidator(error='手机号不合法'))
    sms_captcha = fields.Str(required=True, error_messages={
        'required': '短信验证码不合法'
    }, validate=EmptyStrValidator(error='短信验证码不合法'))
    coordinates = fields.String()

login_schema = LoginSchema()
